<!--
 * @Description: 
 * @Author: dh
 * @Date: 2021-08-19 17:18:39
 * @LastEditors: dh
 * @LastEditTime: 2021-09-15 14:58:16
-->
<!doctype html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
	</head>
	<!-- https://www.cnblogs.com/KingCong/p/9608392.html -->
	<style>
		* {
			margin: 0;
		}
	</style>

	<body>
		<!-- 根据设备像素比 -->
		<img src="http://placehold.it/500" srcset="http://placehold.it/1000 2x, http://placehold.it/2000 3x" />

		<!-- 根据设备像素 -->
		<!-- size类似媒体查询
         (max-width: 400px) 400px,屏幕宽度400以内，匹配srcset内第一个大于等于 400 * 屏幕像素密度，预设宽度400,(最好设置img宽度，预设宽度是否生效和图片有关系)
         (max-width: 800px) 800px,屏幕宽度800以内，匹配srcset内第一个大于等于 800 * 屏幕像素密度，预设宽度800
         其余，匹配1200w
         注意：只能从小到大会有图片匹配的变化，从大到小不会响应，但是预设宽度可以响应
    -->

		<!-- <img
      srcset="
      ../assets/img/天空.jpg 1500w,
      ../assets/img/公司.png 1000w,
      ../assets/img/荷叶.jpg 500w
      "
      sizes="
      (max-width: 500px) 500px,
      (max-width: 1000px) 1000px,
      (max-width: 1500px) 170px,
      220px
  "
      src="../assets/img/天空.jpg"
    /> -->

		<!-- <img srcset="
        http://placehold.it/2000 2000w,
        http://placehold.it/1500 1500w,
        http://placehold.it/1000 1000w,
        http://placehold.it/500   500w
      " sizes="
        (max-width: 500px) 500px,
        (max-width: 1000px) 1000px,
        (max-width: 1500px) 170px,
        220px
     " src="http://placehold.it/500/abc" /> -->

		<!-- <img
      srcset="
        http://placehold.it/2000 2000w,
        http://placehold.it/1500 1500w,
        http://placehold.it/1000 1000w,
        http://placehold.it/500   500w
      "
      sizes="
        (max-width: 500px) 100vw,
        (max-width: 1000px) 80vw,
        (max-width: 1500px) 50vw,
        2000px
    "
      src="http://placehold.it/500/abc"
    /> -->
	</body>
</html>
